import './permission'
import App from './App.vue'
import { createApp } from 'vue'

import router from './router'
import './styles/index.scss'

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
// element css
import 'element-plus/dist/index.css'
// element dark(内置暗黑模式)
import 'element-plus/theme-chalk/dark/css-vars.css'
// custom element dark(自定义暗黑模式)
import '@/styles/index.scss'

import ElSvg from './components/SvgIcon/ElSvg'
// 组织滚轮默认
import 'default-passive-events'

// 重置css
import 'reset-css'
import { setupStore } from '@/stores/index'

// 全局注册组件
import GlobalComponent from './components/index'
//element-plus 挂载icon
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
// 全局引入图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

setupStore(app)
ElSvg(app)
app

  .use(router)
  .use(GlobalComponent)
  .use(ElementPlus, {
    locale: zhCn
  })
  .mount('#app')
